/*    */ package blockbuster.components.appearance;
/*    */ 
/*    */ import blockbuster.components.BedrockComponentBase;
/*    */ import blockbuster.components.IComponentParticleRender;
/*    */ import blockbuster.emitter.BedrockEmitter;
/*    */ import blockbuster.emitter.BedrockParticle;
/*    */ import blockbuster.math.molang.MolangException;
/*    */ import blockbuster.math.molang.MolangParser;
/*    */ import blockbuster.math.molang.expressions.MolangExpression;
/*    */ import com.google.gson.JsonElement;
/*    */ import com.google.gson.JsonObject;
/*    */ import java.util.Map;
/*    */ import java.util.Set;
/*    */ import net.minecraft.client.renderer.BufferBuilder;
/*    */ 
/*    */ public class BedrockComponentCollisionTinting
/*    */   extends BedrockComponentAppearanceTinting
/*    */   implements IComponentParticleRender {
/* 19 */   public MolangExpression enabled = MolangParser.ZERO;
/*    */ 
/*    */ 
/*    */   
/*    */   public BedrockComponentBase fromJson(JsonElement elem, MolangParser parser) throws MolangException {
/* 24 */     if (!elem.isJsonObject()) return super.fromJson(elem, parser);
/*    */     
/* 26 */     JsonObject element = elem.getAsJsonObject();
/*    */     
/* 28 */     if (element.has("enabled")) this.enabled = parser.parseJson(element.get("enabled"));
/*    */     
/* 30 */     return super.fromJson((JsonElement)element, parser);
/*    */   }
/*    */ 
/*    */ 
/*    */   
/*    */   public JsonElement toJson() {
/* 36 */     JsonObject object = new JsonObject();
/*    */     
/* 38 */     object.add("enabled", this.enabled.toJson());
/*    */ 
/*    */     
/* 41 */     JsonObject superJson = (JsonObject)super.toJson();
/* 42 */     Set<Map.Entry<String, JsonElement>> entries = superJson.entrySet();
/*    */     
/* 44 */     for (Map.Entry<String, JsonElement> entry : entries)
/*    */     {
/* 46 */       object.add(entry.getKey(), entry.getValue());
/*    */     }
/*    */     
/* 49 */     return (JsonElement)object;
/*    */   }
/*    */ 
/*    */ 
/*    */   
/*    */   public void render(BedrockEmitter emitter, BedrockParticle particle, BufferBuilder builder, float partialTicks) {
/* 55 */     if (particle.isCollisionTinting(emitter))
/*    */     {
/* 57 */       renderOnScreen(particle, 0, 0, 0.0F, 0.0F);
/*    */     }
/*    */   }
/*    */ 
/*    */ 
/*    */   
/*    */   public int getSortingIndex() {
/* 64 */     return -5;
/*    */   }
/*    */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\blockbuster\components\appearance\BedrockComponentCollisionTinting.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */